/**
 * Copyright © 2016-2025 The Thingsboard Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import "../../../../../scss/constants";

:host {
  width: 100%;
  height: 100%;
  padding: 8px;
}

:host ::ng-deep {
  .tb-bundle-widgets-card {
    .mat-mdc-card-header-text {
      flex: 1;
    }
  }
}

.tb-bundle-widgets-card {
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;

  @media #{$mat-md} {
    width: 80%;
  }

  @media #{$mat-gt-md} {
    width: 60%;
  }

  .title-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    .mat-headline-5 {
      margin: 0;
    }
  }

  .mat-mdc-card-content {
    flex: 1;
    padding: 16px;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .tb-add-widget-button {
    min-height: 56px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #FFFFFF;
    padding: 8px;
    border: 2px dashed rgba(0, 0, 0, 0.08);
    border-radius: 10px;
  }

  .tb-add-widget-button-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .tb-add-widget-button-with-text {
      cursor: pointer;
      display: flex;
      padding: 24px 40px 24px 24px;
      justify-content: center;
      align-items: center;
      gap: 8px;
      border: 2px dashed rgba(0, 0, 0, 0.12);
      border-radius: 10px;
      .tb-add-widget-button-text {
        font-size: 16px;
        font-style: normal;
        font-weight: 500;
        line-height: 24px;
        letter-spacing: 0.25px;
        color: $tb-primary-color;
      }
    }
  }

  .tb-add-bundle-widget-form {
    display: flex;
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 5px 16px 0 rgba(0, 0, 0, 0.04);
  }

  .tb-add-bundle-widget-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 16px;
  }

  .mat-mdc-card-actions {
    justify-content: end;
    gap: 8px;
  }
}

.tb-bundle-widgets-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-top: 8px;
  padding-bottom: 8px;
}

.tb-bundle-widget-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 6px 12px 6px 6px;
  background: #fff;
  gap: 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 5px 16px 0 rgba(0, 0, 0, 0.04);
  .tb-bundle-widget-row-details {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    .tb-bundle-widget-image-preview {
      width: 64px;
      max-height: 52px;
      height: 100%;
      object-fit: contain;
      border-radius: 6px;
    }
    .tb-bundle-widget-details {
      padding: 18px 0;
      flex: 1;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      .tb-bundle-widget-title {
        font-size: 14px;
        font-weight: 400;
        letter-spacing: 0.2px;
        color: rgba(0, 0, 0, 0.76);
      }
      .tb-bundle-widget-deprecated {
        font-size: 13px;
        font-weight: 400;
        color: rgba(0, 0, 0, 0.54);
      }
    }
  }
  .mat-icon {
    color: rgba(0, 0, 0, 0.54);
  }
}
